package com.dianping.cat.consumer.cross.model.entity;

import com.dianping.cat.consumer.cross.model.BaseEntity;
import com.dianping.cat.consumer.cross.model.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;







public class Type
  extends BaseEntity<Type>
{
  private String m_id;
  private long m_totalCount;
  private int m_failCount;
  private double m_failPercent;
  private double m_avg;
  private double m_sum;
  private double m_tps;
  private Map<String, Name> m_names = new LinkedHashMap();






  public void accept(IVisitor visitor) { visitor.visitType(this); }


  public Type addName(Name name) {
/*  35 */     this.m_names.put(name.getId(), name);
    return this;
  }


  public boolean equals(Object obj) {
/*  41 */     if (obj instanceof Type) {
/*  42 */       Type _o = (Type)obj;

/*  44 */       if (!equals(getId(), _o.getId())) {
/*  45 */         return false;
      }

/*  48 */       if (getTotalCount() != _o.getTotalCount()) {
/*  49 */         return false;
      }

/*  52 */       if (getFailCount() != _o.getFailCount()) {
/*  53 */         return false;
      }

/*  56 */       if (getFailPercent() != _o.getFailPercent()) {
/*  57 */         return false;
      }

/*  60 */       if (getAvg() != _o.getAvg()) {
/*  61 */         return false;
      }

/*  64 */       if (getSum() != _o.getSum()) {
/*  65 */         return false;
      }

/*  68 */       if (getTps() != _o.getTps()) {
/*  69 */         return false;
      }

/*  72 */       if (!equals(getNames(), _o.getNames())) {
/*  73 */         return false;
      }


/*  77 */       return true;
    }

/*  80 */     return false;
  }


/*  84 */   public Name findName(String id) { return (Name)this.m_names.get(id); }


  public Name findOrCreateName(String id) {
/*  88 */     Name name = (Name)this.m_names.get(id);

/*  90 */     if (name == null) {
/*  91 */       synchronized (this.m_names) {
/*  92 */         name = (Name)this.m_names.get(id);

/*  94 */         if (name == null) {
/*  95 */           name = new Name(id);
/*  96 */           this.m_names.put(id, name);
        }
      }
    }

/* 101 */     return name;
  }


/* 105 */   public double getAvg() { return this.m_avg; }



/* 109 */   public int getFailCount() { return this.m_failCount; }



/* 113 */   public double getFailPercent() { return this.m_failPercent; }



/* 117 */   public String getId() { return this.m_id; }



/* 121 */   public Map<String, Name> getNames() { return this.m_names; }



/* 125 */   public double getSum() { return this.m_sum; }



/* 129 */   public long getTotalCount() { return this.m_totalCount; }



/* 133 */   public double getTps() { return this.m_tps; }






  public Type incFailCount() {
/* 153 */     this.m_failCount++;
/* 154 */     return this;
  }

  public Type incFailCount(int failCount) {
/* 158 */     this.m_failCount += failCount;
/* 159 */     return this;
  }

  public Type incTotalCount() {
/* 163 */     this.m_totalCount++;
/* 164 */     return this;
  }

  public Type incTotalCount(long totalCount) {
/* 168 */     this.m_totalCount += totalCount;
/* 169 */     return this;
  }


  public void mergeAttributes(Type other) {
/* 174 */     if (other.getId() != null) {
/* 175 */       this.m_id = other.getId();
    }

/* 178 */     this.m_totalCount = other.getTotalCount();

/* 180 */     this.m_failCount = other.getFailCount();

/* 182 */     this.m_failPercent = other.getFailPercent();

/* 184 */     this.m_avg = other.getAvg();

/* 186 */     this.m_sum = other.getSum();

/* 188 */     this.m_tps = other.getTps();
  }


/* 192 */   public Name removeName(String id) { return (Name)this.m_names.remove(id); }


  public Type setAvg(double avg) {
/* 196 */     this.m_avg = avg;
/* 197 */     return this;
  }

  public Type setFailCount(int failCount) {
/* 201 */     this.m_failCount = failCount;
/* 202 */     return this;
  }

  public Type setFailPercent(double failPercent) {
/* 206 */     this.m_failPercent = failPercent;
/* 207 */     return this;
  }

  public Type setId(String id) {
/* 211 */     this.m_id = id;
/* 212 */     return this;
  }

  public Type setSum(double sum) {
/* 216 */     this.m_sum = sum;
/* 217 */     return this;
  }

  public Type setTotalCount(long totalCount) {
/* 221 */     this.m_totalCount = totalCount;
/* 222 */     return this;
  }

  public Type setTps(double tps) {
/* 226 */     this.m_tps = tps;
/* 227 */     return this;
  }
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/cross/model/entity/Type.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */